﻿--今日值班人员
create table tb_OnDuty
(
  ID number(9) primary key,
 Content clob DEFAULT empty_clob(),
  CreateBy varchar2(100),
  CreateTime date not null,
  Note varchar2(100)
);
/

CREATE SEQUENCE tb_OnDuty_Seq
 INCREMENT BY 1   -- 每次加几个  
     START WITH 1     -- 从1开始计数  
     NOMAXVALUE       -- 不设置最大值  
     NOCYCLE          -- 一直累加，不循环  
     CACHE 10;
/
CREATE TRIGGER tb_OnDuty_Tri BEFORE
insert ON  tb_OnDuty FOR EACH ROW
begin
select tb_OnDuty_Seq.nextval into:New.ID from dual;
end
commit;
/
--最近重要作业
create table tb_LatestImportantTask
(
  ID number(9) primary key,
  Content clob  DEFAULT empty_clob(),
  CreateTime date not null,
  CreateBy varchar2(50),
  Note varchar2(100)
);
/
CREATE SEQUENCE tb_LatestImportantTask_Seq
 INCREMENT BY 1   -- 每次加几个  
     START WITH 1     -- 从1开始计数  
     NOMAXVALUE       -- 不设置最大值  
     NOCYCLE          -- 一直累加，不循环  
     CACHE 10;
/
CREATE TRIGGER tb_LatestImportantTask_Tri BEFORE
insert ON  tb_LatestImportantTask FOR EACH ROW
begin
select tb_LatestImportantTask_Seq.nextval into:New.ID from dual;
end
commit;
/
--通知公告 AnnounceMent

create table tb_AnnounceMent
(
  ID number(9) primary key,
  Content clob DEFAULT empty_clob(),
  CreateTime date not null,
  CreateBy varchar2(50),
  Note varchar2(100)
);
/
CREATE SEQUENCE tb_AnnounceMent_Seq
 INCREMENT BY 1   -- 每次加几个  
     START WITH 1     -- 从1开始计数  
     NOMAXVALUE       -- 不设置最大值  
     NOCYCLE          -- 一直累加，不循环  
     CACHE 10;
/
CREATE TRIGGER tb_Announcement_Tri BEFORE
insert ON  tb_Announcement FOR EACH ROW
begin
select tb_AnnounceMent_Seq.nextval into:New.ID from dual;
end
commit;
/
